package com.anhry.app.safety.manage.oa.struts.action;

import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.anhry.app.safety.manage.enterprise.bean.TbCorpInfo;
import com.anhry.app.safety.manage.enterprise.bean.TbCorpInfoView;
import com.anhry.app.safety.manage.enterprise.bean.TbCorpType;
import com.anhry.app.safety.manage.oa.bean.TbOaMailUser;
import com.anhry.app.safety.manage.oa.bean.TbOaNotice;
import com.anhry.app.safety.manage.oa.bean.TbOaNoticeFj;
import com.anhry.app.safety.manage.oa.bean.TbOaNoticeUser;
import com.anhry.app.safety.manage.oa.struts.base.OABaseAction;
import com.anhry.app.safety.manage.system.bean.TbUser;
import com.anhry.app.safety.manage.system.bean.TbUserDept;
import com.anhry.app.safety.manage.system.bean.TbUserGrade;
import com.anhry.app.safety.manage.system.bean.TbUserRole;
import com.anhry.app.safety.manage.system.bean.vo.SystemBean;
import com.anhry.app.safety.util.Constants;
import com.anhry.app.safety.util.DateFormater;
import com.anhry.app.safety.util.Loggers;
import com.anhry.app.safety.util.Page;
import com.anhry.app.safety.util.UploadFile;
import com.anhry.app.safety.util.Util;
import com.anhry.app.safety.util.UtilMethod;

/**
 * 
 * @author chen
 * @date 2012-8-13
 */
@Controller
@Scope("prototype")
@SuppressWarnings("unchecked")
public class NoticeAction extends OABaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static Logger logger = Logger.getLogger(MailAction.class);

	private String beginTime;

	private String endTime;

	private String keyWord;

	private String search;
	
	private String urls;

	private File[] myFile; // 信息附件

	private String[] contentType; // 信息类型

	private String userType; // 用户级别

	private String userUnit; // 用户单位

	private String userDept; // 用户部门

	private List<TbUserDept> deptList; // 部门列表

	private List<TbCorpType> corpTypeList;// 企业类型表

	private String corpUnit; // 企业所属单位(属地)

	private String corpDept; // 企业所属部门(属地)

	private String addUser; // 通知接收者（管理员）

	private String addCorp; // 通知接收者（企业）

	private String corpSelect; // 通知接收者（符合条件的企业）

	private String noticeTitle; // 通知标题

	private String noticeContent; // 通知内容

	private String isExigence; // 紧急程度0：普通1：紧急

	private String isNote; // 是否短信提醒0：否1：是

	private String noteDay; // 短信提醒启动时间（天）

	private String noteHour; // 短信提醒启动时间（小时）

	private String noteSec; // 短信提醒启动时间（秒）

	private String noteContent; // 短信提醒内容

	private Long noticeId;

	private List<TbOaNotice> noticeList; // 通知通告列表

	private List<TbOaNoticeUser> inNoitceList;// 已收通知通告列表

	private Long id; //

	private TbOaNotice notice;

	private TbOaNoticeUser noticeUser;

	private List<TbOaNoticeFj> fjList; // 通知通告附件列表

	private List<TbUser> userNamesList;

	private List<TbCorpInfo> corpNamesList;

	private String forward;

	private Long fjId;

	private boolean editOk;

	private String str_num1;

	private String str_num;

	private String str_size1;

	private String str_size;

	private String readType;

	private List<TbOaNoticeUser> noticeUserList;

	private String isCorper;

	private String sendUser;// 发送人

	private String isNots;// 是否短信

	private String isEs;// 是否紧急

	private String tempUser;

	private String typeMax; // 企业类型大类

	private String typeMin; // 企业类型小类

	private String zyMax; // 专业监管部门大类

	private String zyMin; // 专业监管部门小类

	private String hyMax; // 行业监管部门大类

	private String hyMin; // 行业监管部门小类

	private String sdMax; // 企业所属属地大类

	private String sdMin; // 企业所属属地小类

	private String corpGr; // 企业级别

	private List<TbCorpInfoView> corpList; // 企业列表集合

	private List<TbCorpType> typeList; // 企业类型集合

	private List<TbUserDept> zyList; // 专业监管部门

	private List<TbUserDept> hyList; // 行业监管部门

	private List<TbUserDept> sdList; // 属地集合

	private List<TbOaMailUser> inMailList;

	private String userZws;

	private String menuName;

	private Long userGradeId;

	private boolean userGrade1;

	private String gradeId;

	private String roleId;

	private String unitId;

	private String deptId;

	private String noticeSize;

	private String mailSize;

	private List<TbUser> userList; // 用户列表

	private List<TbUserGrade> gradeList; // 用户级别列表

	private List roleList;

	private List zwList;

	private String cGrade;

	private String cUnit;

	private String cDept;

	private String cRole;

	private String cZw;

	private String cZcType;

	private String[] myFileFileName;// 附件标题

	private String cCounty;

	private String cHy;

	private String cMaxType;

	private String cMinType;

	/**
	 * 跳转到新建通知通告页面
	 * 
	 * @return
	 */
	public String toSend() {
		TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		userGradeId = user.getTbUserGrade().getId();
		setResult("notice_send");
		return "success";
	}

	/**
	 * 查询所有收件人列表
	 * 
	 * @return
	 */
	public String userList() {
		int rowCount = 0;
		int num = (this.num != null && !"".equals(this.num)) ? Integer.parseInt(this.num) : 1;
		int size = (this.size != null && !"".equals(this.size)) ? Integer.parseInt(this.size) : 5;
		decodeKey();// 解码
		try {
			String hql = this.getQuaryHql();
			List objSize = this.systemService.getUserList(hql, 0, 0);
			if (objSize != null && objSize.size() > 0) {
				rowCount = Integer.parseInt(objSize.get(0).toString());
			}
			Page page = new Page(size, num, rowCount);
			this.setPage(page);
			hql += "order by t.gradeId,t.unitId,t.deptId";
			this.setUserList(this.systemService.getUserList(hql, page.getStartRow(), page.getSize()));
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("NoticeAction中userList()方法：" + e);
		}
		setResult("notice_user_list");
		return "success";
	}

	/**
	 * 解码方法
	 * 
	 * @author zhangpeng
	 * 
	 */
	private void decodeKey() {
		if (null == this.getSearch() && (keyWord != null && !"".equals(keyWord))) {
			try {
				keyWord = this.contextPvd.decode(keyWord);
				sendUser = this.contextPvd.decode(sendUser);
			} catch (Exception e) {
				e.printStackTrace();
				logger.error("keyword解码异常：" + e.getMessage());
			}
		}
	}

	/**
	 * 得到查询hql语句
	 * 
	 * @return
	 */
	public String getQuaryHql() {
		StringBuilder hql = new StringBuilder(" where 1=1 ");
		List<TbUserGrade> list = (List) this.contextPvd.getServletContextAttr(Util.USER_GRADE_LIST);// 用户级别
		TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		if (user.getTbUserGrade().getId() == 0 || user.getTbUserGrade().getId() == 1 || user.getTbUserGrade().getId() == 2) {
			this.setGradeList(list);// 用户级别
			try {
				this.setRoleList(this.systemService.getRoleList("0", 0, -1));// 角色列表
			} catch (Exception e) {
				logger.error("NoticeAction中getQuaryHql()方法：" + e);
				e.printStackTrace();
			}
			this.setZwList(SystemBean.getZwList());
		}
		if(user.getTbUserGrade() != null && user.getTbUserGrade().getId() == 8) {//区安办 
			hql.append(" and t.gradeId in (4,6)");
			List templist = new ArrayList();
			for (TbUserGrade tbUserGrade : list) {
				if (tbUserGrade.getId() == 4  || tbUserGrade.getId() == 6) {
					templist.add(tbUserGrade);
				}
			}
			this.setGradeList(templist);// 用户级别
			List<TbUserRole> list1 = null;
			try {
				list1 = this.systemService.getRoleList("0", 0, -1);
			} catch (Exception e) {
				Loggers.error(e.getMessage());
			}
			List templist1 = new ArrayList();
			for (TbUserRole tbUserRole : list1) {
				if (tbUserRole.getId() == 2 || tbUserRole.getId() == 6) {
					templist1.add(tbUserRole);
				}
			}
			// 角色列表
			this.setRoleList(templist1);
			this.setZwList(SystemBean.getZwList());
		}
		
		if (user.getTbUserGrade().getId() == 3) {// 市科室
			hql.append(" and t.gradeId in (4,7)");
			List templist = new ArrayList();
			for (TbUserGrade tbUserGrade : list) {
				if (tbUserGrade.getId() == 4  || tbUserGrade.getId() == 7) {
					templist.add(tbUserGrade);
				}
			}
			this.setGradeList(templist);// 用户级别
			try {
				List<TbUserRole> list1 = this.systemService.getRoleList("0", 0, -1);
				List templist1 = new ArrayList();
				for (TbUserRole tbUserRole : list1) {
					if (tbUserRole.getId() == 2 || tbUserRole.getId() == 3 || tbUserRole.getId() == 4) {
						templist1.add(tbUserRole);
					}
				}
				// 角色列表
				this.setRoleList(templist1);
			} catch (Exception e) {
				logger.error("NoticeAction中getQuaryHql()方法：" + e);
				e.printStackTrace();
			}
			this.setZwList(SystemBean.getZwList());
		}
		if (user.getTbUserGrade().getId() == 4) {// 区科室
			hql.append(" and t.gradeId in (7)");
			hql.append(" and t.unitId in (" + user.getTbUserUnit().getId() + ")");
			List templist = new ArrayList();
			for (TbUserGrade tbUserGrade : list) {
				if (tbUserGrade.getId() == 7) {
					templist.add(tbUserGrade);
				}
			}
			this.setGradeList(templist);// 用户级别
			try {
				List<TbUserRole> list1 = this.systemService.getRoleList("0", 0, -1);
				List templist1 = new ArrayList();
				for (TbUserRole tbUserRole : list1) {
					if (tbUserRole.getId() == 2) {
						templist1.add(tbUserRole);
					}
				}
				// 角色列表
				this.setRoleList(templist1);
			} catch (Exception e) {
				logger.error("NoticeAction中getQuaryHql()方法：" + e);
				e.printStackTrace();
			}
			this.setZwList(SystemBean.getZwList_qj());
		}
		if (user.getTbUserGrade().getId() == 5) {// 市行业5
			hql.append(" and t.gradeId in (6,7)");
			List templist = new ArrayList();
			for (TbUserGrade tbUserGrade : list) {
				if (tbUserGrade.getId() == 7 || tbUserGrade.getId() == 6) {
					templist.add(tbUserGrade);
				}
			}
			this.setGradeList(templist);// 用户级别
			try {
				List<TbUserRole> list1 = this.systemService.getRoleList("0", 0, -1);
				List templist1 = new ArrayList();
				for (TbUserRole tbUserRole : list1) {
					if (tbUserRole.getId() == 2 || tbUserRole.getId() == 3 || tbUserRole.getId() == 4) {
						templist1.add(tbUserRole);
					}
				}
				// 角色列表
				this.setRoleList(templist1);
			} catch (Exception e) {
				logger.error("NoticeAction中getQuaryHql()方法：" + e);
				e.printStackTrace();
			}
			this.setZwList(SystemBean.getZwList());
		}
		if (user.getTbUserGrade().getId() == 6) {// 区行业 6
			hql.append(" and t.gradeId in (7)");
			hql.append(" and t.unitId in (" + user.getTbUserUnit().getId() + ")");
			List templist = new ArrayList();
			for (TbUserGrade tbUserGrade : list) {
				if (tbUserGrade.getId() == 7) {
					templist.add(tbUserGrade);
				}
			}
			this.setGradeList(templist);// 用户级别
			try {
				List<TbUserRole> list1 = this.systemService.getRoleList("0", 0, -1);
				List templist1 = new ArrayList();
				for (TbUserRole tbUserRole : list1) {
					if (tbUserRole.getId() == 2) {
						templist1.add(tbUserRole);
					}
				}
				// 角色列表
				this.setRoleList(templist1);
			} catch (Exception e) {
				logger.error("NoticeAction中getQuaryHql()方法：" + e);
				e.printStackTrace();
			}
			this.setZwList(SystemBean.getZwList_qj());
		}
		if (null != this.keyWord && this.keyWord.length() > 0) {
			hql.append(" and t.userName like '%" + keyWord + "%'");
		}
		if (null != this.cGrade && this.cGrade.length() > 0) {
			hql.append(" and t.gradeId=" + this.cGrade);
		}
		if (null != this.cUnit && this.cUnit.length() > 0) {
			hql.append(" and t.unitId=" + this.cUnit);
		}
		if (null != this.cDept && this.cDept.length() > 0) {
			hql.append(" and t.deptId=" + this.cDept);
		}
		if (null != this.cRole && this.cRole.length() > 0) {
			hql.append(" and t.roleId=" + this.cRole);
		}
		if (null != this.cZw && this.cZw.length() > 0) {
			hql.append(" and t.userZw=" + this.cZw);
		}
		return hql.toString();
	}

	/**
	 * 加载部门、单位
	 */
	public void loadDept() {
		this.contextPvd.getResponse().setCharacterEncoding("utf-8");
		List<TbUserDept> listDept = null;
		StringBuffer opts = new StringBuffer();
		try {
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			listDept = this.getDeptList(this.gradeId, this.unitId);
			if (listDept != null && listDept.size() > 0) {
				opts.append("{"); // 保存选项信息
				int counter = 0; // 计数器
				for (TbUserDept dept : listDept) {
					// 区科室 区行业
					if (user.getTbUserGrade().getId() == 4 || user.getTbUserGrade().getId() == 6) {
						if (dept.getId().equals(user.getTbUserDept().getDeptParentId())) {
							// 如果不是第一项，追加一个“,”用于分隔选项 {'id':'name','id1':'name1'}
							if (counter > 0) {
								opts.append(",");
							}
							opts.append("'");
							opts.append(dept.getId());
							opts.append("':'");
							opts.append(dept.getDeptName());
							opts.append("'");
							counter++;
						}
					} else {
						// 如果不是第一项，追加一个“,”用于分隔选项 {'id':'name','id1':'name1'}
						if (counter > 0) {
							opts.append(",");
						}
						opts.append("'");
						opts.append(dept.getId());
						opts.append("':'");
						opts.append(dept.getDeptName());
						opts.append("'");
						counter++;
					}
					// 计数器加1
				}
				opts.append("}");
			}
			this.contextPvd.getResponse().getWriter().write(opts + "");
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:loadDept()出错：" + e);
			e.printStackTrace();
		}
	}

	public List getDeptList(String gradeId, String unitId) {
		try {
			TbUserDept sysDept = this.systemService.getDeptByCode(Util.DEPT_CODE);
			StringBuilder hql = new StringBuilder("from TbUserDept t where 1=1 and t.isDele=0");
			if ("2".equals(gradeId)) {// 安办
				if (null != unitId) {
					hql.append(" and t.deptParentId=" + unitId);
				} else {
					hql.append(" and t.deptType=0 and t.deptGrade=2 and t.deptClass=1");
				}
			} else if ("3".equals(gradeId)) {// 市级科室
				if (null != unitId) {
					hql.append(" and t.deptParentId=" + unitId);
				} else {
					hql.append(" and t.deptType=1 and t.deptGrade=2 and t.deptClass=1");
				}
			} else if ("4".equals(gradeId)) {// 区级科室
				if (null != unitId) {
					hql.append(" and t.deptParentId=" + unitId + " and t.deptType=1");
				} else {
					hql.append(" and t.deptType=3 and t.deptParentId=" + sysDept.getId());
				}
			} else if ("5".equals(gradeId)) {// 市行业
				if (null != unitId) {
					return null;
				} else {
					hql.append(" and t.deptType=2 and t.deptGrade=2");
				}
			} else if ("6".equals(gradeId)) {// 区行业
				if (null != unitId) {
					hql.append(" and t.deptParentId=" + unitId + " and t.deptType=2");
				} else {
					hql.append(" and t.deptType=3 and t.deptParentId=" + sysDept.getId());
				}
			} else if ("7".equals(gradeId)) {// 属地
				if (null != unitId) {
					hql.append(" and t.deptParentId=" + unitId + " and t.deptType=3");
				} else {
					hql.append(" and t.deptType=3 and t.deptParentId=" + sysDept.getId());
				}
			}
			List<TbUserDept> list = (List) this.utilService.getHqlQuery(hql.toString());
			if (null != list && list.size() > 0 && "4".equals(gradeId) && (null == unitId || "".equals(unitId))) {
				TbUserDept dept = null;
				for (int i = 0; i < list.size(); i++) {
					dept = list.get(i);
					dept.setDeptName(dept.getDeptName() + "安监局");
				}
			}
			return list;
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:getDeptList()出错：" + e.getMessage());
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 查询企业列表
	 * 
	 * @return
	 */
	public String corpList() {
		try {
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			int rowCount = 0;
			int num = (this.num != null && !"".equals(this.num)) ? Integer.parseInt(this.num) : 1;
			int size = (this.size != null && !"".equals(this.size)) ? Integer.parseInt(this.size) : 5;
			String orderHql = "";// 排序hql语句
			String hql = this.getQuaryHqlCorp();
			List objSize = this.enterprisService.getCorpList(hql, null, 0, 0);
			if (objSize != null && objSize.size() > 0) {
				rowCount = Integer.parseInt(objSize.get(0).toString());
			}
			Page page = new Page(size, num, rowCount);
			this.setPage(page);
			this.setCorpList(this.enterprisService.getCorpList(hql, orderHql, page.getStartRow(), page.getSize()));
			this.setSdList(this.enterprisService.getSdList((List)this.contextPvd.getServletContextAttr(Util.QU_DEPT_LIST),user));
			this.setTypeList(this.enterprisService.getTypeList(user));
			this.setHyList((List)this.contextPvd.getServletContextAttr(Util.HY_DEPT_LIST));
			this.setResult("notice_corp_list");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("enterprise: CorpInfoAction:list() 异常：" + e.getMessage());
		}
		return ERROR;
	}

	public String getQuaryHqlCorp() {
		TbUser user = (TbUser)this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		String grade = user.getTbUserGrade().getId().toString();//用户级别
		TbUserDept unit = null;//用户单位
		TbUserDept dept = null;//用户部门
		if(null!=user.getTbUserUnit()){
			unit = user.getTbUserUnit();
		}
		if(null!=user.getTbUserDept()){
			dept = user.getTbUserDept();
		}
		StringBuilder urls = new StringBuilder("");
		StringBuilder hql = new StringBuilder(" where 1=1 ");
		String key = "";
		if(null!=this.keyWord && this.keyWord.length()>0){
			if(null!=this.getSearch() && "1".equals(this.getSearch())){
				key = this.getKeyWord().trim();
			}else{
				key = this.contextPvd.decode(this.getKeyWord());	
			}
			this.setKeyWord(key);
			hql.append(" and t.corpName like '%"+key+"%'");
			urls.append("keyWord="+this.contextPvd.encode(this.keyWord));
		}else{
			urls.append("keyWord=");
		}
		
		if("3".equals(grade) && "3".equals(dept.getDeptClass())){//市科室行业部门
			hql.append(" and t.deptMainId="+dept.getId());
			urls.append("&cHy="+dept.getId().toString());
			this.setCHy(dept.getId().toString());
			if(null!=this.cMaxType && this.cMaxType.length()>0){
				hql.append(" and t.maxTypeId="+this.cMaxType);
				urls.append("&cMaxType="+this.cMaxType);
			}
			if(null!=this.cMinType && this.cMinType.length()>0){
				hql.append(" and t.minTypeId="+this.cMinType);
				urls.append("&cMinType="+this.cMinType);
			}
		}else if("4".equals(grade) && "3".equals(dept.getDeptClass())){//县区科室行业部门
			if((null==this.cMaxType || "".equals(this.cMaxType)) && (null==this.cMinType || "".equals(this.cMinType))){
				hql.append(" and t.quDeptIds like '%"+dept.getId()+"%'");
			}else{
				if(null!=this.cMaxType && this.cMaxType.length()>0){
					hql.append(" and t.maxTypeId="+this.cMaxType);
					urls.append("&cMaxType="+this.cMaxType);
				}
				if(null!=this.cMinType && this.cMinType.length()>0){
					hql.append(" and t.minTypeId="+this.cMinType);
					urls.append("&cMinType="+this.cMinType);
				}
			}
			if(null!=this.cHy && this.cHy.length()>0){
				hql.append(" and t.deptMainId="+this.cHy);
				urls.append("&cHy="+this.cHy);
			}
		}else if("5".equals(grade)){//市行业
			if("1".equals(unit.getDeptClass())){//行业监管
				hql.append(" and t.deptMainId="+unit.getId());
				urls.append("&cHy="+unit.getId().toString());
				this.setCHy(unit.getId().toString());
			}else{//专业监管
				if("5310".equals(unit.getId().toString())){//质监局
					hql.append(" and t.corpIsTeshe=1");
				}else if("5311".equals(unit.getId().toString())){//消防局
					
				}else if("5312".equals(unit.getId().toString())){//气象局
					hql.append(" and t.corpIsBlzh=1");
				}
				if(null!=this.cHy && this.cHy.length()>0){
					hql.append(" and t.deptMainId="+this.cHy);
					urls.append("&cHy="+this.cHy);
				}
			}
			if(null!=this.cMaxType && this.cMaxType.length()>0){
				hql.append(" and t.maxTypeId="+this.cMaxType);
				urls.append("&cMaxType="+this.cMaxType);
			}
			if(null!=this.cMinType && this.cMinType.length()>0){
				hql.append(" and t.minTypeId="+this.cMinType);
				urls.append("&cMinType="+this.cMinType);
			}
		}else if("6".equals(grade)){//区行业
			if("1".equals(dept.getDeptClass())){
				hql.append(" and t.deptMainId="+dept.getDeptSj());
				urls.append("&cHy="+dept.getDeptSj().toString());
				this.setCHy(dept.getDeptSj().toString());
			}else{
				if("5310".equals(dept.getDeptSj().toString())){//质监局
					hql.append(" and t.corpIsTeshe=1");
				}else if("5311".equals(dept.getDeptSj().toString())){//消防局
					
				}else if("5312".equals(dept.getDeptSj().toString())){//气象局
					hql.append(" and t.corpIsBlzh=1");
				}
				if(null!=this.cHy && this.cHy.length()>0){
					hql.append(" and t.deptMainId="+this.cHy);
					urls.append("&cHy="+this.cHy);
				}
			}
			if(null!=this.cMaxType && this.cMaxType.length()>0){
				hql.append(" and t.maxTypeId="+this.cMaxType);
				urls.append("&cMaxType="+this.cMaxType);
			}
			if(null!=this.cMinType && this.cMinType.length()>0){
				hql.append(" and t.minTypeId="+this.cMinType);
				urls.append("&cMinType="+this.cMinType);
			}
		}else{//其他用户
			if(null!=this.cMaxType && this.cMaxType.length()>0){
				hql.append(" and t.maxTypeId="+this.cMaxType);
				urls.append("&cMaxType="+this.cMaxType);
			}
			if(null!=this.cMinType && this.cMinType.length()>0){
				hql.append(" and t.minTypeId="+this.cMinType);
				urls.append("&cMinType="+this.cMinType);
			}
			if(null!=this.cHy && this.cHy.length()>0){
				hql.append(" and t.deptMainId="+this.cHy);
				urls.append("&cHy="+this.cHy);
			}
		}
		
		if("4".equals(grade) || "6".equals(grade) || "8".equals(grade)){//县区安委会、区科室、区行业
			hql.append(" and t.countyId="+unit.getId());
			this.setCCounty(unit.getId().toString());
			if(null!=this.cUnit && this.cUnit.length()>0){
				hql.append(" and t.unitId="+this.cUnit);
				urls.append("&cUnit="+this.cUnit);
			}
			if(null!=this.cDept && this.cDept.length()>0){
				hql.append(" and t.deptId="+this.cDept);
				urls.append("&cDept="+this.cDept);
			}
		}else if("7".equals(grade)){//属地
			hql.append(" and t.countyId="+unit.getId()+" and t.unitId="+dept.getId());
			this.setCCounty(unit.getId().toString());
			this.setCUnit(dept.getId().toString());
			if(null!=this.cDept && this.cDept.length()>0){
				hql.append(" and t.deptId="+this.cDept);
				urls.append("&cDept="+this.cDept);
			}
		}else{
			if(null!=this.cCounty && this.cCounty.length()>0){
				hql.append(" and t.countyId="+this.cCounty);
				urls.append("&cCounty="+this.cCounty);
			}
			if(null!=this.cUnit && this.cUnit.length()>0){
				hql.append(" and t.unitId="+this.cUnit);
				urls.append("&cUnit="+this.cUnit);
			}
			if(null!=this.cDept && this.cDept.length()>0){
				hql.append(" and t.deptId="+this.cDept);
				urls.append("&cDept="+this.cDept);
			}
		}
		if(null!=this.cZcType && this.cZcType.length()>0){
			hql.append(" and t.corpReportType="+this.cZcType);
			urls.append("&cZcType="+this.cZcType);
		}
		if(null!=this.cGrade && this.cGrade.length()>0){
			if("E".equals(this.cGrade)){
				hql.append(" and t.corpGrade is null");
			}else{
				hql.append(" and t.corpGrade='"+this.cGrade+"'");
			}
			urls.append("&cGrade="+this.cGrade);
		}
		hql.append(" and t.isDele=0 and t.corpSize=1");
		this.setUrls(urls.toString());
		return hql.toString();
	}

	/**
	 * 通知发送和修改
	 * 
	 * @return
	 */
	public String noticeSaveOrUpdate() {
		TbOaNotice notice = null;
		TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		String corpIds = "";
		try {
			if (null != this.getNoticeId() && !"".equals(this.getNoticeId())) {// 修改
				notice = (TbOaNotice) this.utilService.getObjectById(TbOaNotice.class, this.getNoticeId());
				if (null != notice) {
					notice.setNoticeContent(this.getNoticeContent());
					this.utilService.update(notice);
					this.noticeService.setIsRead(notice.getId());
					// 上传附件
					noticeFjUpload(notice, user);
					this.setEditOk(true);
					this.setId(notice.getId());
					this.setForward("2");
					return noticeList();
				}
			} else {// 添加
				notice = new TbOaNotice();
				//如果是市安办发布的公告通知
				if(user.getTbUserGrade() != null && user.getTbUserGrade().getId() != null 
						&& Constants.USER_GRADE_ID_OF_CITY_SAFETYCOMMIT.equals(user.getTbUserGrade().getId().toString())) {
					notice.setIsAllowDel(0);
					notice.setIsRed(1);
					notice.setIsTop(1);
				}
				notice.setIsDele("0");
				notice.setIsExigence(this.getIsExigence());
				notice.setIsNote(this.getIsNote());
				notice.setNoteContent(this.getNoteContent());
				notice.setNoteDay(this.getNoteDay());
				notice.setNoteHour(this.getNoteHour());
				notice.setNoteSec(this.getNoteSec());
				notice.setNoticeContent(this.getNoticeContent());
				notice.setNoticeTime(new Date());
				notice.setNoticeTitle(this.getNoticeTitle());
				notice.setTbUser(user);
				notice.setVersion("1.0");
				notice.setIsCorper(this.getIsCorper());
				notice.setAddsUser(this.getAddUser());
				Calendar cd = Calendar.getInstance();
				int year = cd.get(Calendar.YEAR);
				notice.setNoticeYear(String.valueOf(year));// 年度
				int quarter = DateFormater.getQuarter(cd);
				notice.setNoticeQuarter(String.valueOf(quarter));// 季度
				int month = cd.get(Calendar.MONTH) + 1;
				notice.setNoticeMonth(String.valueOf(month));
				// 接收者（企业）
				Set corpSet = new HashSet();
				if (null != this.getAddCorp() && !"".equals(this.getAddCorp())) {
					String[] cos = this.getAddCorp().split(",");
					for (String c : cos) {
						corpSet.add(c);
					}
				}
				// 符合条件的企业
				if (null != this.getCorpSelect() && !"".equals(this.getCorpSelect())) {
					String[] se = this.getCorpSelect().split(",");
					String key1 = "";
					if (!"0".equals(se[7])) {
						key1 = se[7];
					}
				}
				String strr[] = null;
				if (null != corpSet && corpSet.size() > 0) {
					strr = (String[]) corpSet.toArray(new String[0]);// 将set中元素放入数组中
					for (String st : strr) {
						corpIds += st + ",";
					}
					corpIds = corpIds.substring(0, corpIds.length() - 1);
				}
				notice.setAddsCorp(corpIds);
				this.utilService.save(notice);
				TbOaNoticeUser nu = null;
				// 接收者（管理员）关系表
				if (null != this.getAddUser() && !"".equals(this.getAddUser())) {
					String[] addu = this.getAddUser().split(",");
					for (String st : addu) {
						nu = new TbOaNoticeUser();
						nu.setIsDele("0");
						nu.setIsRead("0");
						nu.setTbOaNotice(notice);
						nu.setTbUser((TbUser) this.utilService.getObjectById(TbUser.class, Long.parseLong(st)));
						nu.setUserType("0");// 管理员
						nu.setVersion("1.0");
						nu.setIsNot("0");
						this.utilService.save(nu);
					}
				}
				// 接收者（企业）关系表
				if (null != corpIds && corpIds.length() > 0) {
					String[] addc = corpIds.split(",");
					for (String st : addc) {
						nu = new TbOaNoticeUser();
						nu.setIsDele("0");
						nu.setIsRead("0");
						nu.setTbOaNotice(notice);
						nu.setTbCorpInfo((TbCorpInfo) this.utilService.getObjectById(TbCorpInfo.class, Long.parseLong(st)));
						nu.setUserType("1");// 管理员
						nu.setVersion("1.0");
						this.utilService.save(nu);
					}
				}
				// 上传附件
				noticeFjUpload(notice, user);
				return noticeList();
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeSaveOrUpdate()方法：" + e);
		}

		return ERROR;
	}

	/**
	 * 附件上传
	 * 
	 * @param notice
	 * @param user
	 * @throws Exception
	 */
	private void noticeFjUpload(TbOaNotice notice, TbUser user) throws Exception {
		if (null != myFile && myFile.length > 0) {
			TbOaNoticeFj fj = null;
			for (int j = 0; j < myFile.length; j++) {
				fj = new TbOaNoticeFj();
				fj.setFjTitle(myFileFileName[j]);
				fj.setFjSize(UtilMethod.getFjSize(String.valueOf(myFile[j].length())));
				String path = Util.SAFETY_FILE + File.separator + Util.FILE_FOLDER + File.separator + Util.OA_Notice + File.separator;
				File f = new File(path);
				if (!f.exists())
					f.mkdirs();
				String file_Name = UploadFile.copy(myFile[j], path, myFileFileName[j], user.getId().toString());
				String path1 = Util.FILE_FOLDER + File.separator + Util.OA_Notice + File.separator + user.getId() + File.separator + file_Name;
				fj.setFjPath(path1);
				fj.setIsDele("0");
				fj.setTbOaNotice(notice);
				fj.setVersion("1.0");
				this.utilService.save(fj);
			}
		}
	}

	/**
	 * 已发通知列表
	 * 
	 * @return
	 */
	public String noticeList() {
		try {
			// 解码方法
			decodeKey();
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			List noticeSize = this.noticeService.loadNoticeList(user, this.getBeginTime(), this.getEndTime(), keyWord, 0, 0);
			if (null != noticeSize) {
				rowCount = Integer.parseInt(noticeSize.get(0).toString());
			}
			setPagingParameters();
			this.setNoticeList(this.noticeService.loadNoticeList(user, this.getBeginTime(), this.getEndTime(), keyWord, page.getStartRow(), page.getSize()));
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeList()方法：" + e);
		}
		setResult("notice_list");
		return "success";
	}

	/**
	 * 已收到通知
	 * 
	 * @return
	 */
	public String noticeInList() {
		try {
			// 解码
			decodeKey();
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			List noticeSize = this.noticeService.loadInNoticeList(user, this.getBeginTime(), this.getEndTime(), keyWord, 0, 0);
			if (null != noticeSize) {
				rowCount = Integer.parseInt(noticeSize.get(0).toString());
			}
			setPagingParameters();
			this.setInNoitceList(this.noticeService.loadInNoticeList(user, this.getBeginTime(), this.getEndTime(), keyWord, page.getStartRow(), page.getSize()));
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeInList()方法：" + e);
		}
		setResult("notice_inList");
		return "success";
	}
	
	public String noticeTopList() {
		try {
			// 解码
			decodeKey();
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			List noticeSize = this.noticeService.loadTopNoticeList(user, this.getBeginTime(), this.getEndTime(), keyWord, 0, 0);
			if (null != noticeSize) {
				rowCount = Integer.parseInt(noticeSize.get(0).toString());
			}
			setPagingParameters();
			this.setInNoitceList(this.noticeService.loadTopNoticeList(user, this.getBeginTime(), this.getEndTime(), keyWord, page.getStartRow(), page.getSize()));
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeInList()方法：" + e);
		}
		setResult("notice_topList");
		return "success";
	}

	/**
	 * 通知通告查看
	 * 
	 * @return
	 */
	public String noticeShow() {
		TbOaNotice notice = null;
		try {
			this.setKeyWord(this.contextPvd.encode(this.contextPvd.decode(this.getKeyWord())));
			if (null != this.getId() && !"".equals(this.getId())) {
				notice = (TbOaNotice) this.utilService.getObjectById(TbOaNotice.class, this.getId());
				if (null != notice) {
					this.setNotice(notice);
					// 接收者（管理员）
					if (null != notice.getAddsUser() && !"".equals(notice.getAddsUser())) {
						this.setUserNamesList((List<TbUser>) this.utilService.getHqlQuery("from TbUser user where user.id in(" + notice.getAddsUser() + ")"));
					}
					// 接收者（企业）
					if (null != notice.getAddsCorp() && !"".equals(notice.getAddsCorp())) {
						this.setCorpNamesList((List<TbCorpInfo>) this.utilService.getHqlQuery("from TbCorpInfo corp where corp.id in(" + notice.getAddsCorp() + ")"));
					}
					this.setFjList((List<TbOaNoticeFj>) this.utilService.getHqlQuery("from TbOaNoticeFj fj left join fetch fj.tbOaNotice where fj.tbOaNotice.id='" + notice.getId() + "'"));
					if ("1".equals(this.getForward())) {// 查看
						setResult("notice_show");
					} else if ("2".equals(this.getForward())) {// 修改
						setResult("notice_edit");
					}
					return "success";
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeShow()方法：" + e);
		}

		return ERROR;
	}

	/**
	 * 已收通知查看
	 * 
	 * @return
	 */
	public String noticeInShow() {
		TbOaNotice notice = null;
		TbOaNoticeUser noticeU = null;
		try {
			this.setKeyWord(this.contextPvd.encode(this.contextPvd.decode(this.getKeyWord())));
			if (null != this.getId() && !"".equals(this.getId())) {
				noticeU = (TbOaNoticeUser) this.utilService.getObjectById(TbOaNoticeUser.class, this.getId());
				if (null != noticeU) {
					notice = (TbOaNotice) this.utilService.getObjectById(TbOaNotice.class, noticeU.getTbOaNotice().getId());
					if (null != notice) {
						if ("0".equals(noticeU.getIsRead())) {
							noticeU.setIsRead("1");// 标记为已读
							noticeU.setReadTime(new Date());
							this.utilService.update(noticeU);
						}
						this.setNoticeUser(noticeU);
						this.setNotice(notice);
						this.setFjList((List<TbOaNoticeFj>) this.utilService.getHqlQuery("from TbOaNoticeFj fj left join fetch fj.tbOaNotice where fj.tbOaNotice.id='" + notice.getId() + "'"));
						setResult("notice_inShow");
						return SUCCESS;
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeInShow()方法：" + e);
		}

		return ERROR;
	}

	/**
	 * 异步附件删除
	 */
	public void deleFj() {
		this.contextPvd.getResponse().setContentType("charset=UTF-8");
		TbOaNoticeFj fj = null;
		try {
			if (null != this.getFjId() && !"".equals(this.getFjId())) {
				fj = (TbOaNoticeFj) this.utilService.getObjectById(TbOaNoticeFj.class, this.getFjId());
				if (null != fj) {
					UploadFile.removeFile(this.contextPvd.getRequest().getSession().getServletContext().getRealPath("") + "/" + fj.getFjPath());
					this.utilService.delete(fj);
				}
				this.contextPvd.getResponse().getWriter().write("1");
			} else {
				this.contextPvd.getResponse().getWriter().write("2");
			}
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.info("NoticeAction deleFj()方法：" + e);
		}
	}

	/**
	 * 查看对方阅读状态列表
	 * 
	 * @return
	 */
	public String noticeReadList() {
		try {
			this.setKeyWord(this.contextPvd.encode(this.contextPvd.decode(this.getKeyWord())));
			if (null != this.getId() && !"".equals(this.getId())) {
				TbOaNotice notice = (TbOaNotice) this.utilService.getObjectById(TbOaNotice.class, this.getId());
				this.setNotice(notice);
				List noticeSize = this.noticeService.loadNoticeReadList(this.getId(), this.getReadType(), 0, 0);
				if (null != noticeSize) {
					rowCount = Integer.parseInt(noticeSize.get(0).toString());
				}
				setPagingParameters();
				this.setNoticeUserList(this.noticeService.loadNoticeReadList(this.getId(), this.getReadType(), page.getStartRow(), page.getSize()));
				setResult("notice_read_list");
				return "success";
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeReadList()方法：" + e);
		}
		return ERROR;
	}

	/**
	 * 获取最新消息数量
	 * 
	 */
	public void loadUserNotice() {
		this.getContextPvd().getResponse().setContentType("text/xml; charset=UTF-8");
		this.getContextPvd().getResponse().setHeader("Cache-Control", "no-cache");
		try {
			StringBuffer sbf = new StringBuffer();
			TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
			List<TbOaNoticeUser> notice = (List<TbOaNoticeUser>) this.utilService.getHqlQuery("from TbOaNoticeUser notice left join fetch notice.tbUser where notice.tbUser.id='" + user.getId() + "' and notice.isRead=0 and notice.isDele=0 and notice.userType=0");
			if (null != notice && notice.size() > 0) {
				for (int i = 0; i < notice.size(); i++) {
					sbf.append(notice.get(i).getId() + "," + notice.get(i).getTbOaNotice().getNoticeTitle() + ";");
				}
				sbf.setLength(sbf.length() - 1);
			}
			this.contextPvd.getResponse().getWriter().write(sbf.toString());
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.info("NoticeAction LoadUserMsg()方法：" + e);
		}
	}

	/**
	 * 已发通知汇总
	 * 
	 * @return
	 */
	public String noticeHzList() {
		try {
			// 解码
			decodeKey();
			List<TbUserGrade> list = (List) this.contextPvd.getServletContextAttr(Util.USER_GRADE_LIST);// 用户级别
			this.setGradeList(list);// 用户级别

			List noticeSize = this.noticeService.loadNoticeList(this.getBeginTime(), this.getEndTime(), keyWord, sendUser, getQuaryHqlHz(), this.getIsNots(), this.getIsEs(), 0, 0);
			if (null != noticeSize) {
				rowCount = Integer.parseInt(noticeSize.get(0).toString());
			}
			setPagingParameters();
			this.setNoticeList(this.noticeService.loadNoticeList(this.getBeginTime(), this.getEndTime(), keyWord, sendUser, getQuaryHqlHz(), this.getIsNots(), this.getIsEs(), page.getStartRow(), page.getSize()));
			List<TbUserDept> dList = (List<TbUserDept>) this.utilService.getHqlQuery("from TbUserDept d where d.isDele=0 order by id");
			if (null != dList && dList.size() > 0) {
				for (int i = 0; i < dList.size(); i++) {
					if (dList.get(i).getDeptParentId() == null || dList.get(i).getDeptParentId() == 0 || dList.get(i).getDeptParentId() == 1 || dList.get(i).getDeptParentId() == 2) {
						dList.get(i).setDeptParentId(Long.parseLong("0"));
					}
				}
			}
			this.setDeptList(dList);
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeList()方法：" + e);
		}
		setResult("notice_hzlist");
		return "success";
	}

	/**
	 * 汇总记录查看
	 * 
	 * @return
	 */
	public String noticeHzShow() {
		try {
			// 解码
			this.setKeyWord(this.contextPvd.encode(this.contextPvd.decode(this.getKeyWord())));
			this.setSendUser(this.contextPvd.encode(this.contextPvd.decode(this.getSendUser())));
			if (null != this.getId() && !"".equals(this.getId())) {
				notice = (TbOaNotice) this.utilService.getObjectById(TbOaNotice.class, this.getId());
				if (null != notice) {
					//如果是管理员，没有单位，部门信息
					if (notice.getTbUser().getTbUserDept() != null && notice.getTbUser().getTbUserUnit() != null) {
						notice.getTbUser().setTbUserDept((TbUserDept) utilService.getObjectById(TbUserDept.class, (notice.getTbUser().getTbUserDept().getId())));
						notice.getTbUser().setTbUserUnit((TbUserDept) utilService.getObjectById(TbUserDept.class, (notice.getTbUser().getTbUserUnit().getId())));
					}
					// 接收者（管理员）
					if (null != notice.getAddsUser() && !"".equals(notice.getAddsUser())) {
						this.setUserNamesList((List<TbUser>) this.utilService.getHqlQuery("from TbUser user where user.id in(" + notice.getAddsUser() + ")"));
					}
					// 接收者（企业）
					if (null != notice.getAddsCorp() && !"".equals(notice.getAddsCorp())) {
						this.setCorpNamesList((List<TbCorpInfo>) this.utilService.getHqlQuery("from TbCorpInfo corp where corp.id in(" + notice.getAddsCorp() + ")"));
					}
					this.setFjList((List<TbOaNoticeFj>) this.utilService.getHqlQuery("from TbOaNoticeFj fj left join fetch fj.tbOaNotice where fj.tbOaNotice.id='" + notice.getId() + "'"));
					setResult("notice_hzshow");
					return SUCCESS;
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("NoticeAction中noticeHzShow()方法：" + e);
		}

		return ERROR;
	}

	/**
	 * 获取 未读 消息个数
	 */
	public void getNotRead() {
		TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		try {
			int size = this.noticeService.getNotReadNoticeSize(user);
			this.contextPvd.getResponse().getWriter().print(size);
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.info("NoticeAction中getNotRead()方法：+" + e);
		}
	}
	
	public void getTopNotRead() {
		TbUser user = (TbUser) this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
		try {
			int size = this.noticeService.getTopNotReadNoticeSize(user);
			this.contextPvd.getResponse().getWriter().print(size);
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.info("NoticeAction中getNotRead()方法：+" + e);
		}
	}

	/**
	 * hz列表 用户 条件 得到查询hql语句
	 * 
	 * @return
	 */
	public String getQuaryHqlHz() {
		StringBuilder hql = new StringBuilder();
		if (null != this.cGrade && this.cGrade.length() > 0) {
			hql.append(" and notice.tbUser.tbUserGrade.id=" + this.cGrade);
		}
		if (null != this.cUnit && this.cUnit.length() > 0) {
			hql.append(" and notice.tbUser.tbUserUnit.id=" + this.cUnit);
		}
		if (null != this.cDept && this.cDept.length() > 0) {
			hql.append(" and notice.tbUser.tbUserDept.id=" + this.cDept);
		}
		return hql.toString();
	}

	/**
	 * 加载部门、单位
	 */
	public void loadDeptHz() {
		this.contextPvd.getResponse().setCharacterEncoding("utf-8");
		List<TbUserDept> listDept = null;
		StringBuffer opts = new StringBuffer();
		try {
			listDept = this.getDeptList(this.gradeId, this.unitId);
			if (listDept != null && listDept.size() > 0) {
				opts.append("{"); // 保存选项信息
				int counter = 0; // 计数器
				for (TbUserDept dept : listDept) {
					// 如果不是第一项，追加一个“,”用于分隔选项 {'id':'name','id1':'name1'}
					if (counter > 0) {
						opts.append(",");
					}
					opts.append("'");
					opts.append(dept.getId());
					opts.append("':'");
					opts.append(dept.getDeptName());
					opts.append("'");
					counter++;
					// 计数器加1
				}
				opts.append("}");
			}
			this.contextPvd.getResponse().getWriter().write(opts + "");
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:loadDept()出错：" + e);
			e.printStackTrace();
		}
	}

	public String getTip() {
		return tip;
	}

	public void setTip(String tip) {
		this.tip = tip;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getKeyWord() {
		return keyWord;
	}

	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}

	public String getSearch() {
		return search;
	}

	public void setSearch(String search) {
		this.search = search;
	}

	public File[] getMyFile() {
		return myFile;
	}

	public void setMyFile(File[] myFile) {
		this.myFile = myFile;
	}

	public String[] getMyFileFileName() {
		return myFileFileName;
	}

	public void setMyFileFileName(String[] myFileFileName) {
		this.myFileFileName = myFileFileName;
	}

	public String[] getMyFileContentType() {
		return contentType;
	}

	public void setMyFileContentType(String[] contentType) {
		this.contentType = contentType;
	}

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public String getUserUnit() {
		return userUnit;
	}

	public void setUserUnit(String userUnit) {
		this.userUnit = userUnit;
	}

	public String getUserDept() {
		return userDept;
	}

	public void setUserDept(String userDept) {
		this.userDept = userDept;
	}

	public String getCorpUnit() {
		return corpUnit;
	}

	public void setCorpUnit(String corpUnit) {
		this.corpUnit = corpUnit;
	}

	public String getCorpDept() {
		return corpDept;
	}

	public void setCorpDept(String corpDept) {
		this.corpDept = corpDept;
	}

	public String getAddUser() {
		return addUser;
	}

	public void setAddUser(String addUser) {
		this.addUser = addUser;
	}

	public String getAddCorp() {
		return addCorp;
	}

	public void setAddCorp(String addCorp) {
		this.addCorp = addCorp;
	}

	public String getCorpSelect() {
		return corpSelect;
	}

	public void setCorpSelect(String corpSelect) {
		this.corpSelect = corpSelect;
	}

	public String getNoticeTitle() {
		return noticeTitle;
	}

	public void setNoticeTitle(String noticeTitle) {
		this.noticeTitle = noticeTitle;
	}

	public String getNoticeContent() {
		return noticeContent;
	}

	public void setNoticeContent(String noticeContent) {
		this.noticeContent = noticeContent;
	}

	public String getIsNote() {
		return isNote;
	}

	public void setIsNote(String isNote) {
		this.isNote = isNote;
	}

	public String getNoteDay() {
		return noteDay;
	}

	public void setNoteDay(String noteDay) {
		this.noteDay = noteDay;
	}

	public String getNoteHour() {
		return noteHour;
	}

	public void setNoteHour(String noteHour) {
		this.noteHour = noteHour;
	}

	public String getNoteSec() {
		return noteSec;
	}

	public void setNoteSec(String noteSec) {
		this.noteSec = noteSec;
	}

	public String getNoteContent() {
		return noteContent;
	}

	public void setNoteContent(String noteContent) {
		this.noteContent = noteContent;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Long getNoticeId() {
		return noticeId;
	}

	public void setNoticeId(Long noticeId) {
		this.noticeId = noticeId;
	}

	public String getIsExigence() {
		return isExigence;
	}

	public void setIsExigence(String isExigence) {
		this.isExigence = isExigence;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getForward() {
		return forward;
	}

	public void setForward(String forward) {
		this.forward = forward;
	}

	public Long getFjId() {
		return fjId;
	}

	public void setFjId(Long fjId) {
		this.fjId = fjId;
	}

	public boolean isEditOk() {
		return editOk;
	}

	public void setEditOk(boolean editOk) {
		this.editOk = editOk;
	}

	public String getStr_num1() {
		return str_num1;
	}

	public void setStr_num1(String strNum1) {
		str_num1 = strNum1;
	}

	public String getStr_size1() {
		return str_size1;
	}

	public void setStr_size1(String strSize1) {
		str_size1 = strSize1;
	}

	public String getReadType() {
		return readType;
	}

	public void setReadType(String readType) {
		this.readType = readType;
	}

	public String getIsCorper() {
		return isCorper;
	}

	public void setIsCorper(String isCorper) {
		this.isCorper = isCorper;
	}

	public String getIsEs() {
		return isEs;
	}

	public void setIsEs(String isEs) {
		this.isEs = isEs;
	}

	public String getIsNots() {
		return isNots;
	}

	public void setIsNots(String isNots) {
		this.isNots = isNots;
	}

	public String getSendUser() {
		return sendUser;
	}

	public void setSendUser(String sendUser) {
		this.sendUser = sendUser;
	}

	public String getTempUser() {
		return tempUser;
	}

	public void setTempUser(String tempUser) {
		this.tempUser = tempUser;
	}

	public String getCorpGr() {
		return corpGr;
	}

	public void setCorpGr(String corpGr) {
		this.corpGr = corpGr;
	}

	public String getHyMax() {
		return hyMax;
	}

	public void setHyMax(String hyMax) {
		this.hyMax = hyMax;
	}

	public String getHyMin() {
		return hyMin;
	}

	public void setHyMin(String hyMin) {
		this.hyMin = hyMin;
	}

	public String getSdMax() {
		return sdMax;
	}

	public void setSdMax(String sdMax) {
		this.sdMax = sdMax;
	}

	public String getSdMin() {
		return sdMin;
	}

	public void setSdMin(String sdMin) {
		this.sdMin = sdMin;
	}

	public String getTypeMax() {
		return typeMax;
	}

	public void setTypeMax(String typeMax) {
		this.typeMax = typeMax;
	}

	public String getTypeMin() {
		return typeMin;
	}

	public void setTypeMin(String typeMin) {
		this.typeMin = typeMin;
	}

	public String getZyMax() {
		return zyMax;
	}

	public void setZyMax(String zyMax) {
		this.zyMax = zyMax;
	}

	public String getZyMin() {
		return zyMin;
	}

	public void setZyMin(String zyMin) {
		this.zyMin = zyMin;
	}

	public String getUserZws() {
		return userZws;
	}

	public void setUserZws(String userZws) {
		this.userZws = userZws;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public Long getUserGradeId() {
		return userGradeId;
	}

	public void setUserGradeId(Long userGradeId) {
		this.userGradeId = userGradeId;
	}

	public String[] getContentType() {
		return contentType;
	}

	public void setContentType(String[] contentType) {
		this.contentType = contentType;
	}

	public List<TbCorpInfoView> getCorpList() {
		return corpList;
	}

	public void setCorpList(List<TbCorpInfoView> corpList) {
		this.corpList = corpList;
	}

	public List<TbCorpInfo> getCorpNamesList() {
		return corpNamesList;
	}

	public void setCorpNamesList(List<TbCorpInfo> corpNamesList) {
		this.corpNamesList = corpNamesList;
	}

	public List<TbCorpType> getCorpTypeList() {
		return corpTypeList;
	}

	public void setCorpTypeList(List<TbCorpType> corpTypeList) {
		this.corpTypeList = corpTypeList;
	}

	public List<TbUserDept> getDeptList() {
		return deptList;
	}

	public void setDeptList(List<TbUserDept> deptList) {
		this.deptList = deptList;
	}

	public List<TbOaNoticeFj> getFjList() {
		return fjList;
	}

	public void setFjList(List<TbOaNoticeFj> fjList) {
		this.fjList = fjList;
	}

	public List<TbUserGrade> getGradeList() {
		return gradeList;
	}

	public void setGradeList(List<TbUserGrade> gradeList) {
		this.gradeList = gradeList;
	}

	public List<TbUserDept> getHyList() {
		return hyList;
	}

	public void setHyList(List<TbUserDept> hyList) {
		this.hyList = hyList;
	}

	public List<TbOaMailUser> getInMailList() {
		return inMailList;
	}

	public void setInMailList(List<TbOaMailUser> inMailList) {
		this.inMailList = inMailList;
	}

	public List<TbOaNoticeUser> getInNoitceList() {
		return inNoitceList;
	}

	public void setInNoitceList(List<TbOaNoticeUser> inNoitceList) {
		this.inNoitceList = inNoitceList;
	}

	public String getMailSize() {
		return mailSize;
	}

	public void setMailSize(String mailSize) {
		this.mailSize = mailSize;
	}

	public TbOaNotice getNotice() {
		return notice;
	}

	public void setNotice(TbOaNotice notice) {
		this.notice = notice;
	}

	public List<TbOaNotice> getNoticeList() {
		return noticeList;
	}

	public void setNoticeList(List<TbOaNotice> noticeList) {
		this.noticeList = noticeList;
	}

	public String getNoticeSize() {
		return noticeSize;
	}

	public void setNoticeSize(String noticeSize) {
		this.noticeSize = noticeSize;
	}

	public TbOaNoticeUser getNoticeUser() {
		return noticeUser;
	}

	public void setNoticeUser(TbOaNoticeUser noticeUser) {
		this.noticeUser = noticeUser;
	}

	public List<TbOaNoticeUser> getNoticeUserList() {
		return noticeUserList;
	}

	public void setNoticeUserList(List<TbOaNoticeUser> noticeUserList) {
		this.noticeUserList = noticeUserList;
	}

	public List getRoleList() {
		return roleList;
	}

	public void setRoleList(List roleList) {
		this.roleList = roleList;
	}

	public List<TbUserDept> getSdList() {
		return sdList;
	}

	public void setSdList(List<TbUserDept> sdList) {
		this.sdList = sdList;
	}

	public List<TbCorpType> getTypeList() {
		return typeList;
	}

	public void setTypeList(List<TbCorpType> typeList) {
		this.typeList = typeList;
	}

	public boolean isUserGrade1() {
		return userGrade1;
	}

	public void setUserGrade1(boolean userGrade1) {
		this.userGrade1 = userGrade1;
	}

	public List<TbUser> getUserList() {
		return userList;
	}

	public void setUserList(List<TbUser> userList) {
		this.userList = userList;
	}

	public List<TbUser> getUserNamesList() {
		return userNamesList;
	}

	public void setUserNamesList(List<TbUser> userNamesList) {
		this.userNamesList = userNamesList;
	}

	public List getZwList() {
		return zwList;
	}

	public void setZwList(List zwList) {
		this.zwList = zwList;
	}

	public List<TbUserDept> getZyList() {
		return zyList;
	}

	public void setZyList(List<TbUserDept> zyList) {
		this.zyList = zyList;
	}

	public String getCDept() {
		return cDept;
	}

	public void setCDept(String dept) {
		cDept = dept;
	}

	public String getCGrade() {
		return cGrade;
	}

	public void setCGrade(String grade) {
		cGrade = grade;
	}

	public String getCRole() {
		return cRole;
	}

	public void setCRole(String role) {
		cRole = role;
	}

	public String getCUnit() {
		return cUnit;
	}

	public void setCUnit(String unit) {
		cUnit = unit;
	}

	public String getCZw() {
		return cZw;
	}

	public void setCZw(String zw) {
		cZw = zw;
	}

	public String getStr_num() {
		return str_num;
	}

	public void setStr_num(String str_num) {
		this.str_num = str_num;
	}

	public String getStr_size() {
		return str_size;
	}

	public void setStr_size(String str_size) {
		this.str_size = str_size;
	}

	private String getCCounty() {
		return cCounty;
	}

	public void setCCounty(String county) {
		cCounty = county;
	}

	public String getCHy() {
		return cHy;
	}

	public void setCHy(String hy) {
		cHy = hy;
	}

	public String getCMaxType() {
		return cMaxType;
	}

	public void setCMaxType(String maxType) {
		cMaxType = maxType;
	}

	public String getCMinType() {
		return cMinType;
	}

	public void setCMinType(String minType) {
		cMinType = minType;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public String getGradeId() {
		return gradeId;
	}

	public void setGradeId(String gradeId) {
		this.gradeId = gradeId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getUnitId() {
		return unitId;
	}

	public void setUnitId(String unitId) {
		this.unitId = unitId;
	}

	public String getCZcType() {
		return cZcType;
	}

	public void setCZcType(String zcType) {
		cZcType = zcType;
	}

	public String getUrls() {
		return urls;
	}

	public void setUrls(String urls) {
		this.urls = urls;
	}

}
